#ifndef AUDIORECORDER_H
#define AUDIORECORDER_H

#include <QObject>
#include <QAudioRecorder>
#include <QAudioEncoderSettings>
#include <QUrl>
#include<QDebug>
#include<QDir>
#include <QAudioInput>
#include <QAudioFormat>

class AudioRecorder : public QObject
{
    Q_OBJECT
public:
    explicit AudioRecorder(QObject *parent = 0);
    Q_INVOKABLE void startRecord();
    Q_INVOKABLE void stopRecord();
    Q_PROPERTY(int recordeState READ recordeState NOTIFY recordeStateChanged)
    int recordeState(){
        return recordstausc;
    }

signals:
    void recordeStateChanged();

public slots:
    void onRecordStateChanged();
private:
    QAudioRecorder* recoder;
    QFile *strvic;
    QAudioInput *input;

    int recordstausc;
    QString audio_output_location;
};

#endif // AUDIORECORDER_H
